package com.alatus.utils;

import java.awt.*;

public class GameUtil {
//    地雷的个数
    public static int MINE_MAX = 99;
//    地图的宽度
    public static int MAP_WIDTH = 36;
//    地图的高度
    public static int MAP_HEIGHT = 17;
//    雷区偏移量
    public static int OFFSET = 45;
//    格子边长
    public static int SQUARE_LENGTH = 50;
//    底层元素,0为空,-1为雷,1到8代表对应的雷数
    public static int[][] DATA_BOTTOM = new int[MAP_WIDTH + 2][MAP_HEIGHT + 2];
//    顶部元素,0为未翻开,-1为翻开的,1插旗,2插错旗
    public static int[][] DATA_TOP = new int[MAP_WIDTH + 2][MAP_HEIGHT + 2];
//    地雷
    public static Image mine = Toolkit.getDefaultToolkit().getImage(GameUtil.class.getResource("/imgs/IMG_4773.JPG"));
//    顶层
    public static Image top = Toolkit.getDefaultToolkit().getImage(GameUtil.class.getResource("/imgs/top.gif"));
//    旗子
    public static Image flag = Toolkit.getDefaultToolkit().getImage(GameUtil.class.getResource("/imgs/flag.gif"));
//    插旗数量
    public static int FLAG_NUM = 0;
//    插错旗
    public static Image wrongFlag = Toolkit.getDefaultToolkit().getImage(GameUtil.class.getResource("/imgs/wrongFlag.gif"));
//    鼠标相关,坐标
    public static int MOUSE_X;
    public static int MOUSE_Y;
//    状态
    public static boolean LEFT = false;
    public static boolean RIGHT = false;
//    数字
    public static Image[] images = new Image[9];
//    开始时间
    public static long START_TIME;
//    结束时间
    public static long END_TIME;
//    游戏状态,初始值为3,0游戏中,1胜利,2失败,3难度选择
    public static int state = 3;
//    游戏难度
    public static int level;
    static{
        for (int i = 1; i <= 8; i++) {
            images[i] = Toolkit.getDefaultToolkit().getImage(GameUtil.class.getResource("/imgs/" + i + ".gif"));
        }
    }
    public static void drawWord(Graphics graphics,String str,int x,int y,int size,Color color){
        graphics.setColor(color);
        graphics.setFont(new Font("仿宋",Font.BOLD,size));
        graphics.drawString(str,x,y);
    }
}